include("inc.php");
session_start();
if($id==""){
$id=$_GET['id'];
}
if($id==""){
$id = $_COOKIE['Prime-id'];
$pass = $_COOKIE['Prime-pass'];
}
if($id==""){
if(_S == 1){
header("Location: http://www.blogone.jp/");
}elseif(_S == 0){
header("Location: http://localhost/public/prime/index.php");
}
exit;
}
$com=="";
if(isset($Rback)){
$title = $_SESSION['title'];
$category = "ダイエット";
$temp = "ダイエット";
$Dweight=$_SESSION['Dweight'];
$Dwest=$_SESSION['Dwest'];
$Dyear=$_SESSION['Dyear'];
$Dmonth=$_SESSION['Dmonth'];
$Dday=$_SESSION['Dday'];
$Dkcal=$_SESSION['Dkcal'];
$DDweight=$_SESSION['DDweight'];
$DDwest=$_SESSION['DDwest'];
$bf=$_SESSION['bf'];
$lc=$_SESSION['lc'];
$sp=$_SESSION['sp'];
$sn=$_SESSION['sn'];
$bfkcal=$_SESSION['bfkcal'];
$lckcal=$_SESSION['lckcal'];
$spkcal=$_SESSION['spkcal'];
$snkcal=$_SESSION['snkcal'];
$q1=$_SESSION['q1'];
$q2=$_SESSION['q2'];
$q3=$_SESSION['q3'];
$q4=$_SESSION['q4'];
$q5=$_SESSION['q5'];
$q6=$_SESSION['q6'];
$q7=$_SESSION['q7'];
$q8=$_SESSION['q8'];
$q9=$_SESSION['q9'];
$q10=$_SESSION['q10'];
$q11=$_SESSION['q11'];
$q12=$_SESSION['q12'];
$q13=$_SESSION['q13'];
$q14=$_SESSION['q14'];
$q15=$_SESSION['q15'];
$q16=$_SESSION['q16'];
$q17=$_SESSION['q17'];
$q18=$_SESSION['q18'];
$q19=$_SESSION['q19'];
$q20=$_SESSION['q20'];
$other=$_SESSION['other1'];
$okcal=$_SESSION['okcal'];
$com = str_replace("
","\n",$_SESSION['com1']);
$other = str_replace("
","\n",$_SESSION['other']);
//$com = str_replace("
","\n",$com);
$ex = $_SESSION['ex'];
$Rdata = $_SESSION['Rdate'];
$nc = $_SESSION['snc'];
$weather = $_SESSION['weather'];
$INAME1=$_SESSION['Imgn1'];
$INAME2=$_SESSION['Imgn2'];
$INAME3=$_SESSION['Imgn3'];
$_SESSION['Imgn1']="";
$_SESSION['Imgn2']="";
$_SESSION['Imgn3']="";
$u11 = "$INAME1";
$u22 = "$INAME2";
$u33 = "$INAME3";
if(file_exists("$u11")){
unlink("$u11");
}
if(file_exists("$u22")){
unlink("$u22");
}
if(file_exists("$u33")){
unlink("$u33");
}
$u = "${id}/"."${Rdata}";
$u1 = "${id}/"."${Rdata}/"."image1".".jpg";
$u2 = "${id}/"."${Rdata}/"."image2".".jpg";
$u3 = "${id}/"."${Rdata}/"."image3".".jpg";
if(file_exists("$u1")){
$img1flg=1;
$percent=0;
//画像サイズ自動変更処理
list($width, $height) = getimagesize("$u1");
if($width > $height){
if($width > 180){
$percent = 180 / $width;
}
}elseif($width < $height){
if($height > 135){
$percent = 135 / $height;
}
}else{
if($width > 180){
$percent = 180 / $width;
}
if($height > 135){
$percent = 135 / $height;
}
}
if($percent > 0){
$new_width1 = $width * $percent;
$new_height1 = $height * $percent;
}else{
$new_width1 = $width;
$new_height1 = $height;
}
}
if(file_exists("$u2")){
$img2flg=1;
$percent=0;
//画像サイズ自動変更処理
list($width, $height) = getimagesize("$u2");
if($width > $height){
if($width > 180){
$percent = 180 / $width;
}
}elseif($width < $height){
if($height > 135){
$percent = 135 / $height;
}
}else{
if($width > 180){
$percent = 180 / $width;
}
if($height > 135){
$percent = 135 / $height;
}
}
if($percent > 0){
$new_width2 = $width * $percent;
$new_height2 = $height * $percent;
}else{
$new_width2 = $width;
$new_height2 = $height;
}
}
if(file_exists("$u3")){
$img3flg=1;
$percent=0;
//画像サイズ自動変更処理
list($width, $height) = getimagesize("$u3");
if($width > $height){
if($width > 180){
$percent = 180 / $width;
}
}elseif($width < $height){
if($height > 135){
$percent = 135 / $height;
}
}else{
if($width > 180){
$percent = 180 / $width;
}
if($height > 135){
$percent = 135 / $height;
}
}
if($percent > 0){
$new_width3 = $width * $percent;
$new_height3 = $height * $percent;
}else{
$new_width3 = $width;
$new_height3 = $height;
}
}
}else{
if(!$conn = mysql_connect(_DB_SERVER,_DB_UID,_DB_PASS)){
die('MySQL接続失敗');
}
//データベースの選択
if(!$sts = mysql_select_db(_DB_NAME,$conn)){
die('テーブル選択失敗');
}
$artnum = $_GET['artnum'];
$sql="";
$sql.="select * from album where artnum = '$artnum' group by artnum ";
$mq = mysql_query($sql,$conn);
if($rec = mysql_fetch_array($mq)){
$ownerid = _hs($rec['id']);
$Rdata = _hs($rec['date']);
$title = _hs($rec['title']);
$category = _hs($rec['category']);
$temp = _hs($rec['temp']);
$com = _hs($rec['com']);
$com = str_replace("
","\n",$com);
$img1com = _hs($rec['img1com']);
$img2com = _hs($rec['img2com']);
$img3com = _hs($rec['img3com']);
$img1name = _hs($rec['img1name']);
$img2name = _hs($rec['img2name']);
$img3name = _hs($rec['img3name']);
$ex = _hs($rec['ex']);
$nc = $rec['nc'];
$weather = $rec['weather'];
$Odate = _hs($rec['Odate']);
$OY=substr($Odate,0,4);//年
$OM=substr($Odate,6,2);//月
$OD=substr($Odate,10,2);//日
$u = "${id}/"."${Rdata}";
$u1 = "${id}/"."${Rdata}/"."image1".".jpg";
$u2 = "${id}/"."${Rdata}/"."image2".".jpg";
$u3 = "${id}/"."${Rdata}/"."image3".".jpg";
if(file_exists("$u1")){
$img1flg=1;
$percent=0;
//画像サイズ自動変更処理
list($width, $height) = getimagesize("$u1");
if($width > $height){
if($width > 180){
$percent = 180 / $width;
}
}elseif($width < $height){
if($height > 135){
$percent = 135 / $height;
}
}else{
if($width > 180){
$percent = 180 / $width;
}
if($height > 135){
$percent = 135 / $height;
}
}
if($percent > 0){
$new_width1 = $width * $percent;
$new_height1 = $height * $percent;
}else{
$new_width1 = $width;
$new_height1 = $height;
}
}
if(file_exists("$u2")){
$img2flg=1;
$percent=0;
//画像サイズ自動変更処理
list($width, $height) = getimagesize("$u2");
if($width > $height){
if($width > 180){
$percent = 180 / $width;
}
}elseif($width < $height){
if($height > 135){
$percent = 135 / $height;
}
}else{
if($width > 180){
$percent = 180 / $width;
}
if($height > 135){
$percent = 135 / $height;
}
}
if($percent > 0){
$new_width2 = $width * $percent;
$new_height2 = $height * $percent;
}else{
$new_width2 = $width;
$new_height2 = $height;
}
}
if(file_exists("$u3")){
$img3flg=1;
$percent=0;
//画像サイズ自動変更処理
list($width, $height) = getimagesize("$u3");
if($width > $height){
if($width > 180){
$percent = 180 / $width;
}
}elseif($width < $height){
if($height > 135){
$percent = 135 / $height;
}
}else{
if($width > 180){
$percent = 180 / $width;
}
if($height > 135){
$percent = 135 / $height;
}
}
if($percent > 0){
$new_width3 = $width * $percent;
$new_height3 = $height * $percent;
}else{
$new_width3 = $width;
$new_height3 = $height;
}
}
$sqllist="";
$sqllist.="select * from diet_aim where id = '$id' ";
$sqllist.="group by id";
$mqlist = mysql_query($sqllist,$conn);
while($rec = mysql_fetch_array($mqlist)){
$Dweight=$rec['Dweight'];
$Dwest=$rec['Dwest'];
$Dyear=$rec['Dyear'];
$Dmonth=$rec['Dmonth'];
$Dday=$rec['Dday'];
$Dkcal=$rec['Dkcal'];
}
$sqllist="";
$sqllist.="select * from diet where artnum = '$artnum' ";
$sqllist.="group by artnum";
$mqlist = mysql_query($sqllist,$conn);
while($rec = mysql_fetch_array($mqlist)){
$DDweight=$rec['DDweight'];
$DDwest=$rec['DDwest'];
$bf=$rec['bf'];
$lc=$rec['lc'];
$sp=$rec['sp'];
$sn=$rec['sn'];
$bfkcal=$rec['bfkcal'];
$lckcal=$rec['lckcal'];
$spkcal=$rec['spkcal'];
$snkcal=$rec['snkcal'];
$q1=$rec['q1'];
$q2=$rec['q2'];
$q3=$rec['q3'];
$q4=$rec['q4'];
$q5=$rec['q5'];
$q6=$rec['q6'];
$q7=$rec['q7'];
$q8=$rec['q8'];
$q9=$rec['q9'];
$q10=$rec['q10'];
$q11=$rec['q11'];
$q12=$rec['q12'];
$q13=$rec['q13'];
$q14=$rec['q14'];
$q15=$rec['q15'];
$q16=$rec['q16'];
$q17=$rec['q17'];
$q18=$rec['q18'];
$q19=$rec['q19'];
$q20=$rec['q20'];
$other = _hs($rec['other']);
$okcal = _hs($rec['okcal']);
$other = str_replace("
","\n",$other);
}
}
}
$dateY=date("Y");
$dateM=date("n");
$dateD=date("j");
//MySQLに接続
if(!$conn = mysql_connect(_DB_SERVER,_DB_UID,_DB_PASS)){
die('MySQL接続失敗');
}
//データベースの選択
if(!$sts = mysql_select_db(_DB_NAME,$conn)){
die('テーブル選択失敗');
}
$sqllist="";
$sqllist.="select * from member where id = '$id' group by id";
$mqlist = mysql_query($sqllist,$conn);
if($rec = mysql_fetch_array($mqlist)){
$blogtitle = $rec['blogtitle'];
$ownerskin_id = $rec['skin_id'];
}
$sqllist="";
$sqllist.="select n_category from category where id = '$id' group by id";
$mqlist = mysql_query($sqllist,$conn);
if($rec = mysql_fetch_array($mqlist)){
$l_category = $rec['n_category'];
$l_category=explode("%$&$%","$l_category");
}
//-----------------------レポートアップ処理---------------------------------------------
if(isset($_POST['Rsubmit'])){
$title=_ss(_hs($_POST['title']));
$com=_ss(_hs($_POST['com']));
$Dweight=_ss(_hs($_POST['Dweight']));
$Dwest=_ss(_hs($_POST['Dwest']));
$Dyear=_ss(_hs($_POST['Dyear']));
$Dmonth=_ss(_hs($_POST['Dmonth']));
$Dday=_ss(_hs($_POST['Dday']));
$Dkcal=_ss(_hs($_POST['Dkcal']));
$DDweight=_ss(_hs($_POST['DDweight']));
$DDwest=_ss(_hs($_POST['DDwest']));
$bf=_ss(_hs($_POST['bf']));
$bfkcal=_ss(_hs($_POST['bfkcal']));
$lc=_ss(_hs($_POST['lc']));
$lckcal=_ss(_hs($_POST['lckcal']));
$sp=_ss(_hs($_POST['sp']));
$spkcal=_ss(_hs($_POST['spkcal']));
$sn=_ss(_hs($_POST['sn']));
$snkcal=_ss(_hs($_POST['snkcal']));
$q1=_ss(_hs($_POST['q1']));
$q2=_ss(_hs($_POST['q2']));
$q3=_ss(_hs($_POST['q3']));
$q4=_ss(_hs($_POST['q4']));
$q5=_ss(_hs($_POST['q5']));
$q6=_ss(_hs($_POST['q6']));
$q7=_ss(_hs($_POST['q7']));
$q8=_ss(_hs($_POST['q8']));
$q9=_ss(_hs($_POST['q9']));
$q10=_ss(_hs($_POST['q10']));
$q11=_ss(_hs($_POST['q11']));
$q12=_ss(_hs($_POST['q12']));
$q13=_ss(_hs($_POST['q13']));
$q14=_ss(_hs($_POST['q14']));
$q15=_ss(_hs($_POST['q15']));
$q16=_ss(_hs($_POST['q16']));
$q17=_ss(_hs($_POST['q17']));
$q18=_ss(_hs($_POST['q18']));
$q19=_ss(_hs($_POST['q19']));
$q20=_ss(_hs($_POST['q20']));
$ex=_ss(_hs($_POST['ex']));
$nc=_ss(_hs($_POST['nc']));
$weather=_ss(_hs($_POST['weather']));
$other=_ss(_hs($_POST['other']));
$okcal=_ss(_hs($_POST['okcal']));
$img1 = $_FILES['img1']; //アップロードファイルオブジェクト
$img1tmp = $_FILES['img1']['tmp_name']; //tmpファイル名
$img1name = $_FILES['img1']['name']; //ローカルファイル名
$img1size = $_FILES['img1']['size']; //サイズ
$img1type = $_FILES['img1']['type']; //タイプ
$img2 = $_FILES['img2']; //アップロードファイルオブジェクト
$img2tmp = $_FILES['img2']['tmp_name']; //tmpファイル名
$img2name = $_FILES['img2']['name']; //ローカルファイル名
$img2size = $_FILES['img2']['size']; //サイズ
$img2type = $_FILES['img2']['type']; //タイプ
$img3 = $_FILES['img3']; //アップロードファイルオブジェクト
$img3tmp = $_FILES['img3']['tmp_name']; //tmpファイル名
$img3name = $_FILES['img3']['name']; //ローカルファイル名
$img3size = $_FILES['img3']['size']; //サイズ
$img3type = $_FILES['img3']['type']; //タイプ
$Rdata=date("YmdHis");
$error=array();
$rotate1 = $_POST['rotate1'];
$rotate2 = $_POST['rotate2'];
$rotate3 = $_POST['rotate3'];
$errorflg1="";
$errorflg2="";
$errorflg3="";
$errorflg4="";
$errorflg5="";
$errorflg6="";
$errorflg7="";
$errorflg8="";
$errorflg9="";
$errorflg10="";
//エラーチェック
if($title==""){
$error[]="○タイトルが入力されていません。
対処法:タイトルを入力して下さい。";
$errorflg1="y";
}
/*
if($OY!=""){
if(!ereg("[0-9]{1,4}",$OY)){
$error[]="○日記の日付の年数が不正です。半角数字4文字以内での入力以外できません。";
}
}
if($category=="" and $n_category==""){
$category="日記";
$n_category="";
}
if($n_category=="日記"){
$error[]="○入力されたカテゴリ名はすでに登録されております。
対処法:別のカテゴリ名を入力して下さい。";
$errorflg10="y";
}else{
for($i=1;$l_category[$i]!="";$i++){
if($l_category[$i]==$n_category){
$error[]="○入力されたカテゴリ名はすでに登録されております。
対処法:別のカテゴリ名を入力して下さい。";
$n_category="";
$errorflg10="y";
}
}
}
if($temp==""){
$temp="日記";
}
*/
if($com==""){
$error[]="○コメントが入力されていません。
対処法:コメントを入力して下さい。";
$errorflg2="y";
}
$u1 = "${id}/"."${Rdata}/"."image1".".jpg";
$u2 = "${id}/"."${Rdata}/"."image2".".jpg";
$u3 = "${id}/"."${Rdata}/"."image3".".jpg";
if((!is_uploaded_file($img1tmp)) and ((is_uploaded_file($img2tmp)) or (is_uploaded_file($img3tmp)))){
if(!file_exists("$u1")){
$error[]="○写真1が選択されずに写真2または写真3が選択されました。
対処法:写真のアップは写真1から順に選んでください。";
$errorflg3="y";
}
}elseif((is_uploaded_file($img1tmp)) and (!is_uploaded_file($img2tmp)) and (is_uploaded_file($img3tmp))){
if(!file_exists("$u1") and !file_exists("$u2")){
$error[]="○写真1と写真2が選択されずに写真3が選択されました。
対処法:写真のアップは写真1から順に選んでください。";
$errorflg3="y";
}
}
if($error[0]==""){
if($img1com!="" and (!is_uploaded_file($img1tmp))){
if(!file_exists("$u1")){
$error[] = "○写真1が選択されずに写真1用一言コメントが入力されています。
対処法:写真1を選択してから写真1用一言コメントを入力して下さい。";
$errorflg4="y";
}
}elseif(is_uploaded_file($img1tmp)){
if($img1size < 10000000){
if(!ereg("(\.jpg)$|(\.jpeg)$|(\.JPG)$|(\.JPEG)$",$img1name)){
$error[] = "○写真1の拡張子がjpegまたはjpg以外の写真ファイルはアップ出来ません。";
$errorflg5="y";
}elseif(is_uploaded_file($img1tmp)){
srand(time());
$passchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($passchars);
$i = 0;
while($i < 15){
$IMGNAME1 .= substr($passchars,rand(0,$len - 1),1);
$i++;
}
$u1 = "${id}/"."${Rdata}/"."img1"."$IMGNAME1".".jpg";
$_SESSION['Imgn1']=$u1;
if(!file_exists("${id}/"."${Rdata}")){
mkdir("${id}/"."${Rdata}",0777); //シリアルナンバー名のフォルダ作成・属性(777)
chmod("${id}/"."${Rdata}", 0777);
}
//写真サイズ自動変更処理
list($width, $height) = getimagesize($img1tmp);
if($width > $height){
if($width > 640){
$percent = 640 / $width;
}
}elseif($width < $height){
if($height > 480){
$percent = 480 / $height;
}
}else{
if($width > 640){
$percent = 640 / $width;
}
if($height > 480){
$percent = 480 / $height;
}
}
if($width > 640 or $height > 480){
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($img1tmp);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
if($rotate1!=0){
$image_p = imagerotate($image_p, $rotate1, 0);
}
$boRtn=imagejpeg($image_p,$u1,100);
}else{
$image = imagecreatefromjpeg($img1tmp);
if($rotate1!=0){
$image_p = imagerotate($image, $rotate1, 0);
$boRtn=imagejpeg($image_p,$u1,100);
}else{
$boRtn=move_uploaded_file($img1tmp,$u1);
}
}
if ($boRtn){
chmod("$u1", 0777);
}else{
$error[] = "○写真1のアップロードに失敗しました。
対処法:写真1をもう一度選択し直して下さい。";
$errorflg5="y";
}
}
}else{
$error[] = "○写真1のサイズが大きすぎます。
対処法:アップ出来る写真の容量は500KBまでです。写真の容量を小さくして下さい。";
$errorflg5="y";
}
}elseif($rotate1!=0){
$filename="${id}/"."${Rdata}/"."image1".".jpg";
srand(time());
$passchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($passchars);
$i = 0;
while($i < 15){
$IMGNAME1 .= substr($passchars,rand(0,$len - 1),1);
$i++;
}
$filename2="${id}/"."${Rdata}/"."img1"."$IMGNAME1".".jpg";
$_SESSION['Imgn1']=$filename2;
if(file_exists($filename)){
$source = imagecreatefromjpeg($filename);
// 回転
$image_p = imagerotate($source, $rotate1, 0);
// 出力
imagejpeg($image_p,$filename2,100);
}
}
if($img2com!="" and (!is_uploaded_file($img2tmp))){
if(!file_exists("$u2")){
$error[] = "○写真2が選択されずに写真2用一言コメントが入力されています。
対処法:写真2を選択してから写真2用一言コメントを入力して下さい。";
$errorflg6="y";
}
}elseif(is_uploaded_file($img2tmp)){
if($img2size < 10000000){
if(!ereg("(\.jpg)$|(\.jpeg)$|(\.JPG)$|(\.JPEG)$",$img2name)){
$error[] = "○写真2の拡張子がjpegまたはjpg以外の写真ファイルはアップ出来ません。";
$errorflg7="y";
}elseif(is_uploaded_file($img2tmp)){
srand(time());
$passchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($passchars);
$i = 0;
while($i < 15){
$IMGNAME2 .= substr($passchars,rand(0,$len - 1),1);
$i++;
}
$u2 = "${id}/"."${Rdata}/"."img2"."$IMGNAME2".".jpg";
$_SESSION['Imgn2']=$u2;
if(!file_exists("${id}/"."${Rdata}")){
mkdir("${id}/"."${Rdata}",0777); //シリアルナンバー名のフォルダ作成・属性(777)
chmod("${id}/"."${Rdata}", 0777);
}
//写真サイズ自動変更処理
list($width, $height) = getimagesize($img2tmp);
if($width > $height){
if($width > 640){
$percent = 640 / $width;
}
}elseif($width < $height){
if($height > 480){
$percent = 480 / $height;
}
}else{
if($width > 640){
$percent = 640 / $width;
}
if($height > 480){
$percent = 480 / $height;
}
}
if($width > 640 or $height > 480){
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($img2tmp);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
if($rotate2!=0){
$image_p = imagerotate($image_p, $rotate2, 0);
}
$boRtn=imagejpeg($image_p,$u2,100);
}else{
$image = imagecreatefromjpeg($img2tmp);
if($rotate2!=0){
$image_p = imagerotate($image, $rotate2, 0);
$boRtn=imagejpeg($image_p,$u2,100);
}else{
$boRtn=move_uploaded_file($img2tmp,$u2);
}
}
if ($boRtn){
chmod("$u2", 0777);
}else{
$error[] = "○写真2のアップロードに失敗しました。
対処法:写真2をもう一度選択し直して下さい。";
$errorflg7="y";
}
}
}else{
$error[] = "○写真2のサイズが大きすぎます。
対処法:アップ出来る写真の容量は500KBまでです。写真の容量を小さくして下さい。";
$errorflg7="y";
}
}elseif($rotate2!=0){
$filename="${id}/"."${Rdata}/"."image2".".jpg";
srand(time());
$passchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($passchars);
$i = 0;
while($i < 15){
$IMGNAME2 .= substr($passchars,rand(0,$len - 1),1);
$i++;
}
$filename2="${id}/"."${Rdata}/"."img2"."$IMGNAME2".".jpg";
$_SESSION['Imgn2']=$filename2;
if(file_exists($filename)){
$source = imagecreatefromjpeg($filename);
// 回転
$image_p = imagerotate($source, $rotate2, 0);
// 出力
imagejpeg($image_p,$filename2,100);
}
}
if($img3com!="" and (!is_uploaded_file($img3tmp))){
if(!file_exists("$u3")){
$error[] = "○写真3が選択されずに写真3用一言コメントが入力されています。
対処法:写真3を選択してから写真3用一言コメントを入力して下さい。";
$errorflg8="y";
}
}elseif(is_uploaded_file($img3tmp)){
if($img3size < 10000000){
if(!ereg("(\.jpg)$|(\.jpeg)$|(\.JPG)$|(\.JPEG)$",$img3name)){
$error[] = "○写真3の拡張子がjpegまたはjpg以外の写真ファイルはアップ出来ません。";
$errorflg9="y";
}elseif(is_uploaded_file($img3tmp)){
srand(time());
$passchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($passchars);
$i = 0;
while($i < 15){
$IMGNAME3 .= substr($passchars,rand(0,$len - 1),1);
$i++;
}
$u3 = "${id}/"."${Rdata}/"."img3"."$IMGNAME3".".jpg";
$_SESSION['Imgn3']=$u3;
if(!file_exists("${id}/"."${Rdata}")){
mkdir("${id}/"."${Rdata}",0777); //シリアルナンバー名のフォルダ作成・属性(777)
chmod("${id}/"."${Rdata}", 0777);
}
//写真サイズ自動変更処理
list($width, $height) = getimagesize($img3tmp);
if($width > $height){
if($width > 640){
$percent = 640 / $width;
}
}elseif($width < $height){
if($height > 480){
$percent = 480 / $height;
}
}else{
if($width > 640){
$percent = 640 / $width;
}
if($height > 480){
$percent = 480 / $height;
}
}
if($width > 640 or $height > 480){
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($img3tmp);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
if($rotate3!=0){
$image_p = imagerotate($image_p, $rotate3, 0);
}
$boRtn=imagejpeg($image_p,$u3,100);
}else{
$image = imagecreatefromjpeg($img3tmp);
if($rotate3!=0){
$image_p = imagerotate($image, $rotate3, 0);
$boRtn=imagejpeg($image_p,$u3,100);
}else{
$boRtn=move_uploaded_file($img3tmp,$u3);
}
}
if ($boRtn){
chmod("$u3", 0777);
}else{
$error[] = "○写真3のアップロードに失敗しました。
対処法:写真3をもう一度選択し直して下さい。";
$errorflg9="y";
}
}
}else{
$error[] = "写真3のサイズが大きすぎます。
対処法:アップ出来る写真の容量は500KBまでです。写真の容量を小さくして下さい。";
$errorflg9="y";
}
}elseif($rotate3!=0){
$filename="${id}/"."${Rdata}/"."image3".".jpg";
srand(time());
$passchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$len = strlen($passchars);
$i = 0;
while($i < 15){
$IMGNAME3 .= substr($passchars,rand(0,$len - 1),1);
$i++;
}
$filename2="${id}/"."${Rdata}/"."img3"."$IMGNAME3".".jpg";
$_SESSION['Imgn3']=$filename2;
if(file_exists($filename)){
$source = imagecreatefromjpeg($filename);
// 回転
$image_p = imagerotate($source, $rotate3, 0);
// 出力
imagejpeg($image_p,$filename2,100);
}
}
}
if($error[0]==""){
if($OY==""){
$OY=date("Y");
}
if($OD==""){
$OD=date("d");
}
if($OM==""){
$OM=date("m");
}
$_SESSION['title']=$title;
$_SESSION['com1']=$com;
$_SESSION['snc']=$nc;
$_SESSION['Dweight']=$Dweight;
$_SESSION['Dwest']=$Dwest;
$_SESSION['Dyear']=$Dyear;
$_SESSION['Dmonth']=$Dmonth;
$_SESSION['Dday']=$Dday;
$_SESSION['Dkcal']=$Dkcal;
$_SESSION['DDweight']=$DDweight;
$_SESSION['DDwest']=$DDwest;
$_SESSION['bf']=$bf;
$_SESSION['bfkcal']=$bfkcal;
$_SESSION['lc']=$lc;
$_SESSION['lckcal']=$lckcal;
$_SESSION['sp']=$sp;
$_SESSION['spkcal']=$spkcal;
$_SESSION['sn']=$sn;
$_SESSION['snkcal']=$snkcal;
$_SESSION['q1']=$q1;
$_SESSION['q2']=$q2;
$_SESSION['q3']=$q3;
$_SESSION['q4']=$q4;
$_SESSION['q5']=$q5;
$_SESSION['q6']=$q6;
$_SESSION['q7']=$q7;
$_SESSION['q8']=$q8;
$_SESSION['q9']=$q9;
$_SESSION['q10']=$q10;
$_SESSION['q11']=$q11;
$_SESSION['q12']=$q12;
$_SESSION['q13']=$q13;
$_SESSION['q14']=$q14;
$_SESSION['q15']=$q15;
$_SESSION['q16']=$q16;
$_SESSION['q17']=$q17;
$_SESSION['q18']=$q18;
$_SESSION['q19']=$q19;
$_SESSION['q20']=$q20;
$_SESSION['Rdate']=$Rdata;
$_SESSION['OY']=$OY;
$_SESSION['OM']=$OM;
$_SESSION['OD']=$OD;
$_SESSION['ex']=$ex;
$_SESSION['weather']=$weather;
$_SESSION['other1']=$other;
$_SESSION['okcal']=$okcal;
header("Location: http://www.jhayashida.co.jp/prime/rev_diet_con.php");
exit;
}
}
//-----------------------レポートアップ処理終了---------------------------------------------
?>
$year = $_COOKIE['year'];
if($year == null){
$year = date("Y");
}
$month = $_COOKIE['month'];
if($month == null){
$month = date("n");
}
$move = $_GET['move'];
switch($move){
case -3 ;
$year -= 10;
break;
case -2 ;
$year -= 1;
break;
case -1 ;
$month -= 1;
if($month < 1){ //月が0以下になったときの処理
$month += 12 ;
$year -= 1;
}
break;
case 0 ;
$year = date("Y");
$month = date("n");
break;
case 1 ;
$month += 1;
if($month > 12){ //月が13以上になったときの処理
$month -=12;
$year += 1;
}
break;
case 2 ;
$year += 1;
break;
case 3 ;
$year += 10;
break;
case 4 ;
$year += 100;
break;
}
setcookie("year",$year,time()+60*60);
setcookie("month",$month,time()+60*60);
mb_language("Ja") ;
mb_internal_encoding("JIS") ;
header('content-type: text/html; charset =' ._CHARSET);
?>
Blog One
//更新履歴の表示処理
$rireki = _rireki();
echo "$rireki";
?>
現在の使用容量:%
bgcolor=#ffcccc> | bgcolor=#ccccff> | 100M |
|
<< 年月 >> | SUN |
MON |
TUE |
WED |
THU |
FRI |
SAT |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}?>
}?>
|